package com.example.demo.api.controller;

import com.example.demo.api.exception.TestException;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;

@RestController
@RequestMapping("/API/")
public class TestController {



    @ApiOperation(value = "测试")
    @RequestMapping("test")
    public String test(){
        return "test";
    }

    @RequestMapping("test2")
    public String test2() throws Exception {
        if (true) {
            throw new TestException();
        }
        return "test2";
    }
}
